home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / sharutil.2 / sharutil / sharutils-4.2 / contrib / pas-diffs < prev    next >
Encoding:
Text File  |  1995-02-12  |  4.7 KB  |  145 lines

  1. diff -u 870527-ibm-pc/README 861030-darmon/README
  2. --- 870527-ibm-pc/README    Wed May 27 00:12:39 1987
  3. +++ 861030-darmon/README    Sat Feb 11 20:45:04 1995
  4. @@ -1,20 +1,23 @@
  5. -Here are versions of uuencode and uudecode that will work on an IBM
  6. -PC.  There is a version for Turbo Pascal and one for Microsoft C.
  7. -Porting them into other machines, languages or dialects should not
  8. -pose a large problem.
  9. +Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site hoptoad.uucp
  10. +From: darmon@polaris.UUCP (Pierre Darmon)
  11. +Newsgroups: net.sources
  12. +Subject: Modified Turbo Pascal uudecode/encode. More user-friendly.
  13. +Date: 30 Oct 86 01:12:40 GMT
  14. +Date-Received: 
  15. +Reply-To: darmon@polaris.UUCP (Pierre Darmon)
  16. +Organization: IBM Research, Yorktown Heights, N.Y.
  17.  
  18. -Sorry about the lack of documentation, but the programs are easy to
  19. -use, so you should not have a problem.  I don't know why a UNIX
  20. -site would not have these in the first place, but at least your
  21. -manual should tell you how to use them.  If you are not using UNIX
  22. -at all, you have my sympathy.
  23. +The following are the Turbo Pascal source files for uudecode and uuencode,
  24. +modified from the net posting to display the remaining bytes to be processed,
  25. +instead of filling up the screen with periods. It also displays the percentage
  26. +left. See my previous posting to net.micro,net.micro.pc and net.sources for
  27. +details.
  28.  
  29. -The Pascal programs' author is unknown.  The C programs were
  30. -provided by Don Kneller.
  31. +Enjoy!
  32.  
  33. -Tom Reingold
  34. -Rockefeller University
  35. -New York City
  36. -UUCP:    {seismo | harvard | ihnp4}!cmcl2!rna!rocky2!reintom
  37. -BITNET:  REINTOM@ROCKVAX
  38. -ARPANET: reintom@rockefeller.arpa
  39. +
  40. +-- 
  41. +
  42. +Pierre Darmon, IBM Thomas J. Watson Research Center.                        
  43. +.....seismo!philabs!polaris!darmon.
  44. +darmon.yktvmz.ibm@csnet-relay  
  45. Only in 861030-darmon: diffs
  46. diff -u 870527-ibm-pc/uudecode.pas 861030-darmon/uudecode.pas
  47. --- 870527-ibm-pc/uudecode.pas    Wed May 27 00:12:39 1987
  48. +++ 861030-darmon/uudecode.pas    Sat Feb 11 20:44:32 1995
  49. @@ -6,9 +6,11 @@
  50.    TYPE string80 = string[80];
  51.  
  52.    VAR infile: text;
  53. +      fi    : file of byte;
  54.        outfile: file of byte;
  55.        lineNum: integer;
  56.        line: string80;
  57. +      size,remaining :real;
  58.  
  59.    procedure Abort(message: string80);
  60.  
  61. @@ -23,8 +25,11 @@
  62.  
  63.      begin {NextLine}
  64.        LineNum := succ(LineNum);
  65. -      write('.');
  66. -      readln(infile, s)
  67. +      {write('.');}
  68. +      readln(infile, s);
  69. +      remaining:=remaining-length(s)-2;  {-2 is for CR/LF}
  70. +      write('bytes remaining: ',remaining:7:0,' (',
  71. +            remaining/size*100.0:3:0,'%)',chr(13));
  72.      end; {NextLine}
  73.  
  74.    procedure Init;
  75. @@ -43,7 +48,11 @@
  76.          reset(infile);
  77.          {$i+}
  78.          if IOresult > 0 then abort (concat('Can''t open ', infilename));
  79. -        writeln ('Decoding ', infilename)
  80. +        writeln ('Decoding ', infilename);
  81. +        assign(fi,infilename); reset(fi);
  82. +        size:=FileSize(fi); close(fi);
  83. +        if size < 0 then size:=size+65536.0;
  84. +        remaining:=size;
  85.        end; {GetInFile}
  86.  
  87.      procedure GetOutFile;
  88. @@ -158,7 +167,7 @@
  89.            then abort('Illegal character in line.');
  90.  {        write(line[lineindex]:2);}
  91.          if line[lineindex] = '`' then nextch := ' '
  92. -                                  else nextch := line[lineIndex]
  93. +                                 else nextch := line[lineIndex]
  94.        end; {nextch}
  95.  
  96.      procedure DecodeByte;
  97. diff -u 870527-ibm-pc/uuencode.pas 861030-darmon/uuencode.pas
  98. --- 870527-ibm-pc/uuencode.pas    Wed May 27 00:12:40 1987
  99. +++ 861030-darmon/uuencode.pas    Sat Feb 11 20:44:51 1995
  100. @@ -18,6 +18,7 @@
  101.        line: array [0..59] of char;
  102.        hunk: array [0..2] of byte;
  103.        chars: array [0..3] of byte;
  104. +      size,remaining :real;
  105.  
  106.  {  procedure debug;
  107.  
  108. @@ -70,6 +71,9 @@
  109.          reset (infile);
  110.          {$i+}
  111.          if IOResult > 0 then abort (concat ('Can''t open file ', infilename));
  112. +        size:=FileSize(infile);
  113. +        if size < 0 then size:=size+65536.0;
  114. +        remaining:=size;
  115.          write('Uuencoding file ', infilename);
  116.  
  117.          i := pos('.', infilename);
  118. @@ -131,7 +135,9 @@
  119.        end; {writeout}
  120.  
  121.      begin {FlushLine}
  122. -      write ('.');
  123. +      {write ('.');}
  124. +      write('bytes remaining: ',remaining:7:0,' (',
  125. +            remaining/size*100.0:3:0,'%)',chr(13));
  126.        writeout(chr(bytesInLine + offset));
  127.        for i := 0 to pred(lineLength) do
  128.          writeout(line[i]);
  129. @@ -167,6 +173,7 @@
  130.      begin {encode1};
  131.        if numbytes = bytesperhunk then flushhunk;
  132.        read (infile, hunk[numbytes]);
  133. +      remaining:=remaining-1;
  134.        numbytes := succ(numbytes)
  135.      end; {encode1}
  136.  
  137. @@ -190,5 +197,6 @@
  138.    begin {uuencode}
  139.      init;
  140.      while not eof (infile) do encode1;
  141. -    terminate
  142. +    terminate;
  143. +    writeln;
  144.    end. {uuencode}
  145.